package com.hmall.common.interceptor;

import feign.RequestInterceptor;
import feign.RequestTemplate;

/**
 * 自定义的feign拦截器
 */
public class MyFeignInterceptor implements RequestInterceptor {
    /**
     * Called for every request. Add data using methods on the supplied {@link RequestTemplate}.
     *
     * @param template
     */
    @Override
    public void apply(RequestTemplate template) {
        //重新把aut=2对象添加进去请求头中
        template.header("authorization", "2");
    }
}
